<template>
  <view>
    <u--form :model="skuContent" :rules="rules" ref="form">
      <view class="flex">
        <slot name="left"></slot>
        <!-- <view v-if="isBatch"
                      >
                      <u-checkbox
                        @change="childCheck($event, [index, childIndex])"
                        :checked="isChecked([index, childIndex])"
                    />
                    </view> -->

        <view class="flex1">
          <view class="flex flex-btw">
            <view>{{ skuContent.specAttrNameList }}</view>
            <view class="flex"
              >上下架<u-switch
                v-model="skuContent.status"
                :activeValue="1"
                :inactiveValue="0"
              ></u-switch>
            </view>
          </view>
          <view class="flex flex-btw">
            <view class="flex flex1"
              ><u-form-item prop="price" label="价格/元" labelWidth="80px">
                <u--input
                  v-model="skuContent.price"
                  maxlength="10"
                  :showWordLimit="true"
                  placeholder="请输入售卖价格"
              /></u-form-item>
            </view>
          </view>
          <view class="flex flex-btw">
            <!-- <view>库存</view> -->
            <view class="flex flex1">
              <u-form-item label="库存" prop="inventory" labelWidth="80px">
                <u--input
                  v-model="skuContent.inventory"
                  maxlength="10"
                  :showWordLimit="true"
                  placeholder="请输入售卖库存"
              /></u-form-item>
            </view>
          </view>
        </view>
      </view>
    </u--form>
  </view>
</template>
<script>
export default {
  data() {
    return {
      rules: {
        price: [
          {
            required: true,
            message: "此为必填字段",
            // blur和change事件触发检验
            trigger: ["blur", "change"],
          },
        ],
        inventory: [
          {
            required: true,
            message: "此为必填字段",
            // blur和change事件触发检验
            trigger: ["blur", "change"],
          },
        ],
      },
    };
  },
  props: {
    skuContent: {
      type: Object,
      require: true,
    },
  },
  mounted() {
    this.$refs.form.setRules(this.rules);
  },
  methods: {},
};
</script>
<style lang='scss' scoped>
</style>
